import tweepy
from time import sleep
import request

# Consumer keys and access tokens, used for OAuth
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''

# OAuth process, using the keys and tokens
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

# Get auth url
try:
    redirect_url = auth.get_authorization_url()
    print(redirect_url)
except tweepy.TweepError:
    print('Error! Failed to get request token.')

verifier = input('Verifier:')

# PIN Handling
try:
    auth.get_access_token(verifier)
except tweepy.TweepError:
    print('Error! Failed to get access token.')

# Creation of the actual interface, using authentication
api = tweepy.API(auth)

print("It's Working!")
while True:
    # load image
    imagePath = "./forg.png"
    # Send the tweet.
    api.update_with_media(imagePath)
    sleep(900)
    continue